/**
 * Copyright (c) 2012-3-25, lysong01@gmail.com. All rights reserved.
 * 题目大意（回忆版）：第一行输入一个数n，1 <= n <= 1000，下面输入n行数据，每一行有两个数，分别是x y。输出一组x y，该组数据是所有数据中x最小，且在x相等的情况下y最小的。  
 
Sample:  
 
Input:  
5  
3 3  
2 2  
5 5  
2 1  
3 6  
 
Output:  
2 1 
 */
package bupt.jike;

import java.util.Scanner;

/**
 * @author  liyasong
 * @version %I%, %G%
 * @since   liyasong1.0
 */
public class Pro2010_2 implements Comparable<Pro2010_2>{
	private int x,y;
	
	public Pro2010_2(int x, int y) {
		this.x = x;
		this.y = y;
	}

	@Override
	public int compareTo(Pro2010_2 o) {
		if (this.x > o.x) {
			return 1;
		} else if (this.x == o.x){
			if (this.y > o.y) {
				return 1;
			} else if(this.y == o.y){
				return 0;
			} else { return -1;}
		} else { return -1;}
	}


	public static void main(String[] args) {
		Scanner sca = new Scanner(System.in);
		int n = sca.nextInt();
		Pro2010_2 min = new Pro2010_2(sca.nextInt(), sca.nextInt());
		Pro2010_2 node;
		while (n > 1) {
			node = new Pro2010_2(sca.nextInt(), sca.nextInt());
			if (min.compareTo(node) == 1) {
				min = node;
			}
			n--;
		}
		System.out.println(min.x+" "+min.y);
	}

}
